package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Studystaff entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "studystaff", catalog = "bms")
public class Studystaff implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date cvEng;
	private Date cvSpa;
	private Date delegation;
	private Date fechaFirmaAnmat;
	private Date finantialDisclosure;
	private String gcp;
	private boolean protocolSpecificTrainingMandatory;
    private String protocolTraining;
    private String name;
    private String role;
	private Date stopDate;
	private Integer subInvestigadorZieher;
	private String taoPassword;
    private Integer scope;

    public static final String CLASSTITLE = "Study Staff";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
            Collections.unmodifiableMap(
                    new LinkedHashMap<String, String>() {
                        {
                            put("name", "Name");
                            put("role", "Role");
                            put("cvEng", "CV English");
                            put("cvSpa", "CV Spanish");
                            put("delegation", "Delegation (start date)");
                            put("finantialDisclosure", "Finantial Disclosure");
                            put("taoPassword", "TAO (password)");
                            put("fechaFirmaAnmat", "Fecha firma de la declaración jurada ANMAT?");
                            put("gcp", "GCP Training");
                            put("protocolSpecificTrainingMandatory", "Protocol specific training mandatory");
                            put("protocolTraining", "Protocol Training");
                            put("stopDate", "Stop date (important to avoid tracking documents)");
                            put("subInvestigadorZieher", "Sub-investigatodor listado en la DDJJ para Zieher");
                        }
                    }
            )
    );

    // Constructors

	/** default constructor */
	public Studystaff() {
	}

	/** minimal constructor */
	public Studystaff(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Studystaff(ProtocoloCentro protocoloCentro, Date cvEng,
			Date cvSpa, Date delegation, Date fechaFirmaAnmat,
			Date finantialDisclosure, String gcp,
			boolean protocolSpecificTrainingMandatory, String protocolTraining,
			String role, Date stopDate, Integer subInvestigadorZieher,
			String taoPassword) {
		this.protocoloCentro = protocoloCentro;
		this.cvEng = cvEng;
		this.cvSpa = cvSpa;
		this.delegation = delegation;
		this.fechaFirmaAnmat = fechaFirmaAnmat;
		this.finantialDisclosure = finantialDisclosure;
		this.gcp = gcp;
		this.protocolSpecificTrainingMandatory = protocolSpecificTrainingMandatory;
		this.protocolTraining = protocolTraining;
		this.role = role;
		this.stopDate = stopDate;
		this.subInvestigadorZieher = subInvestigadorZieher;
		this.taoPassword = taoPassword;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "cvEng", length = 10)
	public Date getCvEng() {
		return this.cvEng;
	}

	public void setCvEng(Date cvEng) {
		this.cvEng = cvEng;
	}

    @Temporal(TemporalType.DATE)
    @Column(name = "cvSpa")
	public Date getCvSpa() {
		return this.cvSpa;
	}

	public void setCvSpa(Date cvSpa) {
		this.cvSpa = cvSpa;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "delegation", length = 10)
	public Date getDelegation() {
		return this.delegation;
	}

	public void setDelegation(Date delegation) {
		this.delegation = delegation;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "fechaFirmaAnmat", length = 10)
	public Date getFechaFirmaAnmat() {
		return this.fechaFirmaAnmat;
	}

	public void setFechaFirmaAnmat(Date fechaFirmaAnmat) {
		this.fechaFirmaAnmat = fechaFirmaAnmat;
	}

    @Temporal(TemporalType.DATE)
    @Column(name = "funcionalDisclosure")
	public Date getFinantialDisclosure() {
		return this.finantialDisclosure;
	}

	public void setFinantialDisclosure(Date finantialDisclosure) {
		this.finantialDisclosure = finantialDisclosure;
	}

	@Column(name = "gcp")
	public String getGcp() {
		return this.gcp;
	}

	public void setGcp(String gcp) {
		this.gcp = gcp;
	}

	@Column(name = "protocolSpecificTrainingMandatory")
	public boolean getProtocolSpecificTrainingMandatory() {
		return this.protocolSpecificTrainingMandatory;
	}

	public void setProtocolSpecificTrainingMandatory(
			boolean protocolSpecificTrainingMandatory) {
		this.protocolSpecificTrainingMandatory = protocolSpecificTrainingMandatory;
	}

	@Column(name = "protocolTraining")
	public String getProtocolTraining() {
		return this.protocolTraining;
	}

	public void setProtocolTraining(String protocolTraining) {
		this.protocolTraining = protocolTraining;
	}

	public String getRole() {
		return this.role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "stopDate", length = 10)
	public Date getStopDate() {
		return this.stopDate;
	}

	public void setStopDate(Date stopDate) {
		this.stopDate = stopDate;
	}

	@Column(name = "subInvestigadorZieher")
	public Integer getSubInvestigadorZieher() {
		return this.subInvestigadorZieher;
	}

	public void setSubInvestigadorZieher(Integer subInvestigadorZieher) {
		this.subInvestigadorZieher = subInvestigadorZieher;
	}

    @Column(name = "taoPassword")
    public String getTaoPassword() {
        return this.taoPassword;
    }

    public void setTaoPassword(String taoPassword) {
        this.taoPassword = taoPassword;
    }

    @Column(name = "name")
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}